package com.wxy.demo.controller;

import org.springframework.security.access.annotation.Secured;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/***
 * <p>
 * Description: 权限接口
 * </p>
 * @author wangxiaoyuan
 * 2021年12月08日
 */
@RestController
public class HomeController {

    @Secured("findAll")
    @GetMapping("/findAll")
    public Object findAll() {
        return "访问findAll接口";
    }

    @Secured("add")
    @PostMapping("/add")
    public Object add() {
        return "访问add接口";
    }

    @GetMapping("/hello")
    public Object hello() {
        return "访问hello接口";
    }



}
